<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>注册</title>
    <include file="Common:header_include"/>
</head>
<body>
<!--顶部开始-->
<include file="Common:header"/>
<!--顶部结束-->
<!--主体内容开始-->
<div class="pwd_main register">
    <div class="row bt">
        <div class="col-xs-2"></div>
        <div class="col-xs-9"><span class="glyphicon glyphicon-edit" style="color: #e4393c; margin-right: 10px;"></span>免费注册</div>
    </div>
    <div class="row">
        <div class="col-xs-3"></div>
        <div class=" col-xs-9" style="margin:15px 0;">创建您的账号<span style="color: red;">（以下信息*皆为必填项，请认真填写）</span></div>
    </div>
    <form  class="form-horizontal va-m form Validform" id="demoform-1"   enctype="multipart/form-data" action="{:U('DoctorInfo/reg')}"  method="post">
        <div class="form-group">
            <label class="col-xs-4 control-label "><i style="color: #e4393c">*</i>&nbsp;&nbsp;手机号码：</label>
            <div class="col-xs-5">
                <!--<input type="text" value="" name="name" class="form-control" datatype="z2-4" nullmsg="请输入中文名！" errormsg="中文名为2~4个中文字符！" />-->
                <input type="text" class="form-control" name="phone"  id="phone" autocomplete="off" placeholder="请输入手机号码" datatype="m"  nullmsg="请输入手机号码" errormsg="请输入正确的手机号" value="">
            </div>
            <div class="col-xs-2">
            </div>
        </div>

        <div class="form-group">
            <label class="col-xs-4 control-label"><i style="color: #e4393c">*</i>&nbsp;&nbsp;验证码：</label>
            <div class="col-xs-2 ">
                <input type="text" class="form-control" autocomplete="off" disabled  name="messsagecode" id="messsagecode"  placeholder="请输入短信验证码" datatype="n6-6"  nullmsg="请输入短信验证码" errormsg="验证码为6位数字" >
            </div>
            <div class="col-xs-2">

            </div>
            <div class="col-xs-1" style="margin-left: -2.9%">
                <input class="btn btn-primary radius" type="button"  style="background: #00b683;border-color: #00b683" value="获取验证码" onclick="sendmsg(this)" >
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-4 control-label"><i style="color: #e4393c">*</i>&nbsp;&nbsp;登录密码：</label>
            <div class="col-xs-5">
                <input type="password" name="passwd" class="form-control" autocomplete="off" plugin="passwordStrength"  placeholder="登录密码" datatype="s6-12" nullmsg="请输入6-12位字符" errormsg="密码至少6个字符,最多12个字符">
            </div>
            <div class="col-xs-2">

            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-4 control-label"><i style="color: #e4393c">*</i>&nbsp;&nbsp;重复密码：</label>
            <div class="col-xs-5">
                <input type="password" class="form-control" autocomplete="off" placeholder="请再输入一次密码!" datatype="s6-12" recheck="passwd" nullmsg="请再输入一次密码！" errormsg="您两次输入的账号密码不一致！" >
            </div>
            <div class="col-xs-2">
            </div>
        </div>
        <div class="form-group">
            <div class="col-xs-3"></div>
            <div class=" col-xs-9" style="margin:15px 0;">完善您的个人资料 <span style="color: red;">（以下信息*皆为必填项，请认真填写）</span></div>
        </div>
        <div class="form-group">
            <label class="col-xs-4 control-label"><i style="color: #e4393c">*</i>&nbsp;&nbsp;真实姓名：</label>
            <div class="col-xs-5">
                <input type="text" class="form-control" autocomplete="off" name="realname" placeholder="请输入您的姓名" datatype="*2-6" nullmsg="输入2-6位字符" errormsg="输入2-6位字符" value="">
            </div>
            <div class="col-xs-2">
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-4 control-label"><i style="color: #e4393c">*</i>&nbsp;&nbsp;职称：</label>
            <div class="col-xs-5">
                <select class="select form-control" size="1" name="titleid"  datatype="*" nullmsg="请选择您的职称">
                       <option value="">请选择</option>
                       <volist name=":getlists(positioninfo)" id="v">
                           <option value="{$v['id']}">{$v['name']}</option>
                       </volist>
                </select>
            </div>
            <div class="col-xs-2">
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-4 control-label"><i style="color: #e4393c">*</i>&nbsp;&nbsp;科室：</label>
            <div class="col-xs-5">
                   <select class="select form-control" size="1" name="officeid" datatype="*" nullmsg="请选择您的科室">
                      <option value="">请选择</option>
                       <volist name=":getDepartmentinfoTree()" id="v">
                           <option value="{$v['id']}"  <if condition="$v['pid'] eq 0">disabled</if>>{$v['name']}</option>
                       </volist>
                   </select>
            </div>
            <div class="col-xs-2">
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-4 control-label"><i style="color: #e4393c">*</i>&nbsp;&nbsp;所属医院：</label>

            <div class="formControl col-xs-5">
					<select class="select form-control" size="1"  name="hospitalid" datatype="*" nullmsg="请选择您所在的医院">
                        <option value="">请选择</option>
                         <volist name=":getlists(hospitalinfo)" id="v">
                           <option value="{$v['id']}">{$v['name']}</option>
                       </volist>
                    </select>
            </div>
            <div class="col-xs-2">

            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-4 control-label"><i style="color: #e4393c"></i>&nbsp;&nbsp;医院地址：</label>
            <div class="col-xs-2">
                <select class="select form-control" size="1" id="provinceid"   name="provenceID" onchange="onchangeProvince($(this))">
                    <volist name=":getaerainfoList()" id="v">
                        <option value="{$v['aerainfo_id']}">{$v['aerainfo_name']}</option>
                    </volist>
                </select>
            </div>
            <div class="col-xs-2">
                <select class="select form-control" size="1" name="cityid"  onchange="onchangecity($(this))" id="city">
                    <option value="" selected="" disabled="disabled">请选择</option>
                </select>
            </div>
            <div class="col-xs-2">
                <select class="select form-control"  name="regionid"    id="district">
                    <option value="" selected="" disabled="disabled">请选择</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-4 control-label"><i style="color: #e4393c">*</i>&nbsp;&nbsp;医师证照：</label>
            <div class="col-xs-5 ">
                <input type="file" class="form-control" autocomplete="off" placeholder="" name="certCover"  >
            </div>
            <div class="col-xs-2">
            </div>
        </div>
        <div class="form-group" style="margin:50px 0 80px 0">
            <div class="col-xs-2 col-xs-offset-4">
                <input class="btn btn-primary form-control" type="submit"  value="立即注册"   style="background: #00b683;border-color: #00b683;padding: 0 40px">
            </div>
        </div>
    </form>
    <div class="tishi_bottom va-m">
        <p style="font-weight: bold">已经注册？请
            <a href="{:U(pwd)}">点击这里</a> 忘记了密码？
            <span>请认真、仔细地填写您的信息，以便我们尽快审核资料！<b style="color:red;">*</b>为必填项</span>
        </p>
    </div>
</div>
<!--主体内容结束-->
<!--尾部开始-->
<include file="Common:footer"/>

<!--尾部结束-->
</body>

<script>
    function onchangeProvince(jqObj){
        var province_id = jqObj.val();
        var citycheck = $('#city');
        citycheck.html('');
        $.ajax({
            url: '{:U("getCityListJson")}?province_id=' + province_id,
            type: 'post',
            enctype: 'multipart/form-data',
            success: function (data) {
                $.each(data, function (i, item) {
                    citycheck.append('<option value="' + item.aerainfo_id + '" >' + item.aerainfo_name + '</option>');
//                    var diseaseHtml="<div class='skin-minimal check-box' style='width: 200px;margin-top: 5px'> <div class='check-box'> <input type='checkbox' name='disease_id[]' checked value='"+item.id+"'>"+item.title+"</div> </div>";
//                    diseaseBox.append(diseaseHtml);
                });
                onchangecity(citycheck);
            },
        });
    }
    function onchangecity(jqObj){
        var city_id = jqObj.val();
        var districtcheck = $('#district');
        var ajaxurl='{:U("getDistrictJson")}?city_id=' + city_id;
        districtcheck.html('');
        $.ajax({
            url:ajaxurl ,
            type: 'post',
            enctype: 'multipart/form-data',
            success: function (data) {
                $.each(data, function (i, items) {
                    districtcheck.append('<option value="'+ items.aerainfo_id + '" >'+ items.aerainfo_name + '</option>');
                });
            }
        });
    }
    /***
     * 发送验证码
     * @param obj
     */
    function  sendmsg(obj) {
        var ajaxurl = "{:U(sendmsg)}";
        $phone=$("#phone").val();
        if(verification($phone)){
            $("#messsagecode").removeAttr("disabled");
            $.ajax({
                url:ajaxurl,
                data:{
                    phone:$phone
                },
                type:"Post",
                dataType:"json",
                success:function(data){
                    layer.msg(data.msg)
                    settime(obj);
                }
            });
        }else{
            layer.msg('请输入正确的手机号!')
        }
    }
</script>
</html>